import screen from "@/pages/wordPage/src/screen";

export class Obj{
    x;
    y;
    width;
    height;
    name="obj";
    canColliding=false;
    zIndex=0;
    maxLife=Date.now()+999999999;

    constructor() {
        screen.objList.push(this);
        console.log(1)

    }

    draw(p){
        if (Date.now()>this.maxLife){
            this.destroy();
        }
    }
    onClick(){


    }
    destroy(){
        screen.objList=screen.objList.filter(item=>{
            if (item==this)return false;
            return true;
        })
    }
}